Skip to content

fix(emit): wrap no_mangle-family attrs as unsafe for edition-2024 round-trip#15

Open
jakobjung10 wants to merge 1 commit into
zalanlevai:mainfrom
jakobjung10:fix/no-mangle-roundtrip
Open

fix(emit): wrap no_mangle-family attrs as unsafe for edition-2024 round-trip#15
jakobjung10 wants to merge 1 commit into
zalanlevai:mainfrom
jakobjung10:fix/no-mangle-roundtrip

Conversation

@jakobjung10

Copy link
Copy Markdown

When the generated crate is pretty-printed and recompiled at the 2024 edition, bare #[no_mangle] / #[export_name] / #[link_section] attributes are rejected. Macros expanded from earlier-edition dependencies can emit the bare form, which broke recompilation of the mutant crate.

In the macro-expansion sanitizer, rewrite these attributes to the #[unsafe(...)] form when the edition is 2024 or later.

…nd-trip

When the generated crate is pretty-printed and recompiled at the 2024 edition,
bare `#[no_mangle]` / `#[export_name]` / `#[link_section]` attributes are
rejected. Macros expanded from earlier-edition dependencies can emit the bare
form, which broke recompilation of the mutant crate.

In the macro-expansion sanitizer, rewrite these attributes to the
`#[unsafe(...)]` form when the session edition is 2024 or later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant